package com.nine.entity;

/**
 * ShoppingcartitemId entity. @author MyEclipse Persistence Tools
 */

public class ShoppingcartitemId implements java.io.Serializable {

	// Fields

	private Shoppingcart shoppingcart;
	private Integer itemId;

	// Constructors

	/** default constructor */
	public ShoppingcartitemId() {
	}

	/** full constructor */
	public ShoppingcartitemId(Shoppingcart shoppingcart, Integer itemId) {
		this.shoppingcart = shoppingcart;
		this.itemId = itemId;
	}

	// Property accessors

	public Shoppingcart getShoppingcart() {
		return this.shoppingcart;
	}

	public void setShoppingcart(Shoppingcart shoppingcart) {
		this.shoppingcart = shoppingcart;
	}

	public Integer getItemId() {
		return this.itemId;
	}

	public void setItemId(Integer itemId) {
		this.itemId = itemId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ShoppingcartitemId))
			return false;
		ShoppingcartitemId castOther = (ShoppingcartitemId) other;

		return ((this.getShoppingcart() == castOther.getShoppingcart()) || (this
				.getShoppingcart() != null
				&& castOther.getShoppingcart() != null && this
				.getShoppingcart().equals(castOther.getShoppingcart())))
				&& ((this.getItemId() == castOther.getItemId()) || (this
						.getItemId() != null
						&& castOther.getItemId() != null && this.getItemId()
						.equals(castOther.getItemId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getShoppingcart() == null ? 0 : this.getShoppingcart()
						.hashCode());
		result = 37 * result
				+ (getItemId() == null ? 0 : this.getItemId().hashCode());
		return result;
	}

}